from django.shortcuts import render
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import viewsets
from rest_framework.filters import SearchFilter, OrderingFilter
from .serializers import *
from .filters import *
from .models import *
from apps.pagination import *


# Create your views here.
class UserProfileListViewSet(viewsets.ModelViewSet):
    """
        UserProfileListViewSet

    """
    queryset = UserProfile.objects.all()  # queryset
    serializer_class = UserProfileSerializer
    pagination_class = StandardResultsSetPagination
    filter_backends = (DjangoFilterBackend, SearchFilter, OrderingFilter)
    filter_class = UserProfileFilter
    search_fields = []


class ClerkListViewSet(viewsets.ModelViewSet):
    """
        ClerkListViewSet

    """
    queryset = Clerk.objects.all()  # queryset
    serializer_class = ClerkSerializer
    pagination_class = StandardResultsSetPagination
    filter_backends = (DjangoFilterBackend, SearchFilter, OrderingFilter)
    filter_class = ClerkFilter
    search_fields = []


class CustomerListViewSet(viewsets.ModelViewSet):
    """
        CustomerListViewSet

    """
    queryset = Customer.objects.all()  # queryset
    serializer_class = CustomerSerializer
    pagination_class = StandardResultsSetPagination
    filter_backends = (DjangoFilterBackend, SearchFilter, OrderingFilter)
    filter_class = CustomerFilter
    search_fields = []